﻿@using GSLMS.Entity
@using GSLMS.Entity.Enum
@model IEnumerable<GSLMS.Entity.TB_APP_PROINFO>
@{
    Layout = null;
    int i = 1;
    var SearchParma = ViewData["SearchParma"] as GSLMS.Entity.TB_APP_PROINFO ?? new GSLMS.Entity.TB_APP_PROINFO();
    var ddlDepID = ViewData["DepID"] as SelectList;
    var ddlProduct = ViewData["Product"] as SelectList;

    SearchParma.APPDATE = DateTime.Now.AddMonths(-1);
    SearchParma.APPDATE_END = DateTime.Now;    
}
<form id="pagerForm" method="get" action="RiskAudit/Audit/AuditAssign/index?action=page&OpID=@ViewData["OperateID"]">
<input type="hidden" name="pageNum" value="1" />
<input type="hidden" name="numPerPage" value="@ViewData["pageSize"]" />
<input type="hidden" name="RowCount" value="@ViewData["RowCount"]" />
<input type="hidden" name="CUSTNAME" value="@SearchParma.CUSTNAME" />
<input type="hidden" name="DEPID" value="@SearchParma.DEPID" />
<input type="hidden" name="PRODUCTID" value="@SearchParma.PRODUCTID" />
<input type="hidden" name="RiskDealingStatus" value="@SearchParma.RiskDealingStatus" />
<input type="hidden" name="RiskDealingStatus2" value="@SearchParma.RiskDealingStatus2" />
</form>
<div class="pageHeader">
    <form onsubmit="return navTabSearch(this)" id="Form_@ViewData["CurrentController"]" action="RiskAudit/Audit/AuditAssign/index?action=search&OpID=@ViewData["OperateID"]"
    method="post">
    <div class="searchBar">
        <table class="searchContent">
            <tr>
                <th>
                    客户名称：
                </th>
                <td>
                   @Html.TextBox("CUSTNAME", SearchParma.CUSTNAME, new { @style="width:100px;"})
                </td>
                <th>
                    所属部门：
                </th>
                <td>
                    @Html.DropDownList("DepID", ddlDepID, GSLMS.WebAPP.HelperCommon.SelectDefaultValue, new { @style = "width:100px;" })
                </td>
                <th>
                    贷款产品:
                </th>
                <td>
                    @Html.DropDownList("ProductID", ddlProduct, GSLMS.WebAPP.HelperCommon.SelectDefaultValue, new { @style = "width:80px;" })
                </td>
                <th>
                    分配状态:
                </th>
                <td>
                     <input type="checkbox" name="RiskDealingStatus" value="1" @(SearchParma.RiskDealingStatus==1?"checked='checked'":"")  /><span>未分配
                    </span>
                     <input type="checkbox" name="RiskDealingStatus2" value="1" @(SearchParma.RiskDealingStatus2==1?"checked='checked'":"") />
                    <span>已分配
                    </span>
                </td>
                <td align="right">
                    <div class="subBar">
                        <ul>
                            <li>
                                <div class="buttonActive">
                                    <div class="buttonContent">
                                        <button type="submit" name="submit">
                                            检索</button></div>
                                </div>
                            </li>
                            <li>
                                <div class="buttonActive">
                                    <div class="buttonContent">
                                        <button type="reset" name="reset">
                                            重置</button></div>
                                </div>
                            </li>
                        </ul>
                    </div>
                </td>
            </tr>
        </table>
    </div>
    </form>
</div>
<div class="pageContent">
    @Html.Partial("Buttons")
    <table class="list" layouth="120" id="tableDirectorAssignProInfoList">
        <thead>
            <tr class="header">
                <th style="width:80px;">
                    申请编号
                </th>
                <th style="width:135px;">
                    客户名称
                </th>
                <th style="width:80px;">
                    项目经理
                </th>
                <th style="width:100px;">
                    所属部门
                </th>
                <th style="width:80px;">
                    贷款产品
                </th>
                <th style="width:100px;">
                    申请额度(万元)
                </th>
                <th style="width:100px;">
                    审批日期
                </th>
                <th style="width:100px;">
                    所属分配
                </th>
                <th style="width:80px;">
                    分配状态
                </th>
            </tr>
        </thead>
        @foreach (var item in Model)
        {            
            <tr target="Assign_id" rel="@item.ID" STATUS="@item.STATUS">
                <td>
                   <a href="DianDang/Apply/ProInfo/Details/@item.ID?OpID=@ViewData["OperateID"]" Target="dialog" rel="RiskAuditGAuditAssignV"  title="查看立项申请【@item.CUSTNAME】">
                        @item.APPLYNO
                    </a>
                </td>
                <td>
                    @item.CUSTNAME
                </td>
                <td style="text-align:center;">
                    @item.SALESMAN
                </td>
                <td style="text-align:center;">@item.DEPNAME
                </td>
                <td style="text-align:center;">@item.PRODUCTNAME
                </td>
                <td style="text-align:right;">@item.AMOUNT.ToString("N")
                </td>
                <td style="text-align:center;">
                    @(item.AduAssign.ASSIGNTIME == null ? "" : (item.AduAssign.ASSIGNTIME.Value.ToString("yyyy-MM-dd HH:mm:ss")))
                </td>
                <td style="text-align:center;">
                    @item.AduAssign.FLOWUSER
                </td>
                <td style="text-align:center;">
                    @(item.RiskDealingStatus<1?"未分配":"已分配")
                </td>
            </tr>
            i += 1;
        }
    </table>
</div>
@Html.Partial("PageBar")
<script type="text/javascript">
    function toFlowBack(obj) {
        $this = $(obj);
        var id = $("#tableDirectorAssignProInfoList").find(".selected").attr("rel");
        if (id) {
            var Status = $("#tableDirectorAssignProInfoList").find(".selected").attr("STATUS");
            var url = "RiskAudit/Director/DirectorAssign/BackTo/" + id;
            if (Status && Status >= 31)
                alertMsg.error("分配已经提交，不允许再退回。");
            else {
                var v = alertMsg.confirm("");
                // var back = ajaxTodo(url, "forwardConfirmMsg", "您确定要退回此笔立项申请信息吗?");
                ajaxTodo(url, "navTabAjaxDone");
            }
        }
        else {
            alertMsg.error("请选择一条记录");
        }
    }
</script>
